#用于修正同一个商品用了两个商品编号的问题
#
#
#source_code='20008880' target_code='20008880	'
#source_code='22002258' target_code='20002258'
#source_code='20003518' target_code='20005958'
#
# 1) move source code pw detail and po detail to target code by changing goods_id
# 2) fix spaced record - use this code
# 3) delete or disable code goods in psi - manually
# 4) fix spaced goods code or name - manually
#
load 'util_fix_goods.rb'

source_code='20003518'
target_code='20005958'

#this line initialize $rds $goodsName... in util_fix_goods.rb
prepare_fixer

# step 1
puts "merging #{source_code} to #{target_code}..."
merge_details(source_code,target_code)

# step 2
puts "fixing #{target_code}..."
fix_goods(target_code)

puts "fixing #{source_code}..."
fix_goods(source_code)
